3.11.54 \(\int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x)) \, dx\) [1054]

Optimal. Leaf size=26 \[ -\frac {i c (a+i a \tan (e+f x))^m}{f m} \]

[Out]

-I*c*(a+I*a*tan(f*x+e))^m/f/m

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3603, 3568, 32} \begin {gather*} -\frac {i c (a+i a \tan (e+f x))^m}{f m} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^m*(c - I*c*Tan[e + f*x]),x]

[Out]

((-I)*c*(a + I*a*Tan[e + f*x])^m)/(f*m)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x)) \, dx &=(a c) \int \sec ^2(e+f x) (a+i a \tan (e+f x))^{-1+m} \, dx\\ &=-\frac {(i c) \text {Subst}\left (\int (a+x)^{-1+m} \, dx,x,i a \tan (e+f x)\right )}{f}\\ &=-\frac {i c (a+i a \tan (e+f x))^m}{f m}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(95\) vs. \(2(26)=52\).
time = 1.97, size = 95, normalized size = 3.65 \begin {gather*} -\frac {i 2^m c \left (e^{i f x}\right )^m \left (\frac {e^{i (e+f x)}}{1+e^{2 i (e+f x)}}\right )^m \sec ^{-m}(e+f x) (\cos (f x)+i \sin (f x))^{-m} (a+i a \tan (e+f x))^m}{f m} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^m*(c - I*c*Tan[e + f*x]),x]

[Out]

((-I)*2^m*c*(E^(I*f*x))^m*(E^(I*(e + f*x))/(1 + E^((2*I)*(e + f*x))))^m*(a + I*a*Tan[e + f*x])^m)/(f*m*Sec[e +
 f*x]^m*(Cos[f*x] + I*Sin[f*x])^m)

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 25, normalized size = 0.96

method result size
derivativedivides \(-\frac {i c \left (a +i a \tan \left (f x +e \right )\right )^{m}}{f m}\) \(25\)
default \(-\frac {i c \left (a +i a \tan \left (f x +e \right )\right )^{m}}{f m}\) \(25\)
norman \(-\frac {i c \,{\mathrm e}^{m \ln \left (a +i a \tan \left (f x +e \right )\right )}}{f m}\) \(27\)
risch \(-\frac {i c \,{\mathrm e}^{\frac {m \left (-i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i \left (f x +e \right )}\right )^{3}+2 i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i \left (f x +e \right )}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right )-i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i \left (f x +e \right )}\right ) \mathrm {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right )^{2}+i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i \left (f x +e \right )}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2}-i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i \left (f x +e \right )}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )-i \pi \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3}+i \pi \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )+i \pi \,\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2}-i \pi \,\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \mathrm {csgn}\left (i a \right )-i \pi \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3}+i \pi \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \mathrm {csgn}\left (i a \right )+4 \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )-2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )+2 \ln \left (2\right )+2 \ln \left (a \right )\right )}{2}}}{f m}\) \(511\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

-I*c*(a+I*a*tan(f*x+e))^m/f/m

________________________________________________________________________________________

Maxima [A]
time = 0.54, size = 25, normalized size = 0.96 \begin {gather*} -\frac {i \, a^{m} c {\left (i \, \tan \left (f x + e\right ) + 1\right )}^{m}}{f m} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e)),x, algorithm="maxima")

[Out]

-I*a^m*c*(I*tan(f*x + e) + 1)^m/(f*m)

________________________________________________________________________________________

Fricas [A]
time = 1.12, size = 38, normalized size = 1.46 \begin {gather*} -\frac {i \, c \left (\frac {2 \, a e^{\left (2 i \, f x + 2 i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{m}}{f m} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e)),x, algorithm="fricas")

[Out]

-I*c*(2*a*e^(2*I*f*x + 2*I*e)/(e^(2*I*f*x + 2*I*e) + 1))^m/(f*m)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 71 vs. \(2 (20) = 40\).
time = 0.22, size = 71, normalized size = 2.73 \begin {gather*} \begin {cases} x \left (- i c \tan {\left (e \right )} + c\right ) & \text {for}\: f = 0 \wedge m = 0 \\c x - \frac {i c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} & \text {for}\: m = 0 \\x \left (i a \tan {\left (e \right )} + a\right )^{m} \left (- i c \tan {\left (e \right )} + c\right ) & \text {for}\: f = 0 \\- \frac {i c \left (i a \tan {\left (e + f x \right )} + a\right )^{m}}{f m} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**m*(c-I*c*tan(f*x+e)),x)

[Out]

Piecewise((x*(-I*c*tan(e) + c), Eq(f, 0) & Eq(m, 0)), (c*x - I*c*log(tan(e + f*x)**2 + 1)/(2*f), Eq(m, 0)), (x
*(I*a*tan(e) + a)**m*(-I*c*tan(e) + c), Eq(f, 0)), (-I*c*(I*a*tan(e + f*x) + a)**m/(f*m), True))

________________________________________________________________________________________

Giac [A]
time = 1.17, size = 23, normalized size = 0.88 \begin {gather*} -\frac {i \, {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{m} c}{f m} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e)),x, algorithm="giac")

[Out]

-I*(I*a*tan(f*x + e) + a)^m*c/(f*m)

________________________________________________________________________________________

Mupad [B]
time = 0.17, size = 46, normalized size = 1.77 \begin {gather*} -\frac {c\,{\left (\frac {a\,\left (2\,{\cos \left (e+f\,x\right )}^2+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{2\,{\cos \left (e+f\,x\right )}^2}\right )}^m\,1{}\mathrm {i}}{f\,m} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^m*(c - c*tan(e + f*x)*1i),x)

[Out]

-(c*((a*(sin(2*e + 2*f*x)*1i + 2*cos(e + f*x)^2))/(2*cos(e + f*x)^2))^m*1i)/(f*m)

________________________________________________________________________________________